From c5d086117982b1997389afd08a52ddaf2fdf8254 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 5 Oct 2009 22:07:06 +0200 Subject: [PATCH] Don't request window sizes with zero width or height Zero width/height is unsupported and will magically be turned into one. For instance, gtk_widget_size_allocate() will eventually do this magic on the value stored in widget->allocation. However, if we don't do this magic conversion early, then the value returned from gtk_window_compute_configure_request() will not be comparable with whats stored in widget->allocation. (I.E. they will differ if width or height are zero). This is dangerous, as we do such a comparison in gtk_window_move_resize(). Currently a change from e.g. 10x1 (current allocation) to 10x0 (new size) will be expected to produce a ConfigureNotify, when it actually won't, thus never thawing the frozen toplevel. Fixes bug #588059 --- gtk/gtkwindow.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index c0815a9322..36c5a65193 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5648,6 +5648,13 @@ gtk_window_compute_configure_request_size (GtkWindow *window, if (info->resize_height > 0) *height = info->resize_height; } + + /* Don't ever request zero width or height, its not supported by + gdk. The size allocation code will round it to 1 anyway but if + we do it then the value returned from this function will is + not comparable to the size allocation read from the GtkWindow. */ + *width = MAX (*width, 1); + *height = MAX (*height, 1); } static GtkWindowPosition -- 2.30.2